package com.example.weight.wormHandle.garbageDisposal;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

import com.example.weight.R;
import com.example.weight.wormHandle.cultivate.cultivateNav;
import com.example.weight.wormHandle.garbageDisposal.onsiteDispose.onsiteDisposeNav;
import com.example.weight.wormHandle.garbageDisposal.researchDevelopment.researchDevelopmentNav;
import com.example.weight.wormHandle.wormHandleNav;
import com.hjq.bar.OnTitleBarListener;
import com.hjq.bar.TitleBar;

public class garbageDisposalNav extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_garbage_disposal_nav);
        Intent previousIntent = getIntent();
        final String name = previousIntent.getStringExtra("name");
        final String factory = previousIntent.getStringExtra("factory");

        TitleBar titleBar = findViewById(R.id.titleBar);
        titleBar.setOnTitleBarListener(new OnTitleBarListener() {
            @Override
            public void onLeftClick(View v) {
                finish();
            }

            @Override
            public void onTitleClick(View v) {}

            @Override
            public void onRightClick(View v) {}
        });

        Button researchDevelopmentNav, onsiteDisposeNav;
        researchDevelopmentNav = findViewById(R.id.research_development_nav);
        onsiteDisposeNav = findViewById(R.id.onsite_dispose_nav);

        researchDevelopmentNav.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(garbageDisposalNav.this, researchDevelopmentNav.class);
                intent.putExtra("name", name);
                Log.d("garbagedosponavi",factory);
                intent.putExtra("factory", factory);
                startActivity(intent);
            }
        });

        onsiteDisposeNav.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(garbageDisposalNav.this, onsiteDisposeNav.class);
                intent.putExtra("name", name);
                intent.putExtra("factory", factory);
                startActivity(intent);
            }
        });

    }
}